package com.xiamaliu.demo.service.impl;

import com.alibaba.fastjson2.JSONObject;
import com.xiamaliu.spring.annotation.GPService;
import com.xiamaliu.demo.service.IQueryService;
import lombok.extern.slf4j.Slf4j;

import java.text.SimpleDateFormat;
import java.util.Date;

@Slf4j
@GPService
public class QueryService implements IQueryService {
    @Override
    public String query(String name) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = format.format(new Date());
        JSONObject obj = new JSONObject();
        obj.put("name", name);
        obj.put("time", time);
        return obj.toJSONString();
    }
}
